package cc.gpai.util.slotboard.example;

import cc.gpai.util.slotboard.CustomFactory;
import cc.gpai.util.slotboard.CustomSignal;
import cc.gpai.util.slotboard.CustomSlot;
import cc.gpai.util.slotboard.SlotBoard;

public class CustomFactoryExample {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		MyItf i = new MyItf(){

			@Override
			public void doSomething() {
				System.out.println("Hello!");
			}};
		CustomFactory factory = new CustomFactory();
		factory.put(MyItf.class, i);
		CustomSignal<Object> signal = factory.createSignal();
		CustomSlot slot = factory.createSlot();
		SlotBoard.connect(signal, slot);
		MyItf x = signal.as(MyItf.class);
		System.out.println(x);
		x.doSomething();
	}

}